#include <iostream>
using namespace std;
#include <vector>
#include <unordered_map>

class Solution
{
public:
    static bool CheckPermutation(const string& s1, const string& s2)
    {
        if(s1.size() != s2.size())
            return false;
        int hash[26] = {0};
        for(auto e : s1)
        {
            hash[e-'a']++;
        }
        for(auto e : s2)
        {
            hash[e-'a']--;
            if(hash[e-'a'] < 0)
                return false;
        }
        return true;
    }
};